import { Vec2 } from "./geometry";

export enum VertexFlag {
  NONE = 0,
  OPEN_START = 1,
  OPEN_END = 2,
  LOCAL_MIN = 4,
  LOCAL_MAX = 8,
}

export class Vertex {
  point: Vec2;
  next: Vertex | undefined;
  prev: Vertex | undefined;
  flag: VertexFlag = VertexFlag.NONE;

  constructor(point: Vec2) {
    this.point = point;
  }

  get x() {
    return this.point.x;
  }

  get y() {
    return this.point.y;
  }
}
